package com.sqsf.jdk;
//jdk代理基于接口
//与目标类实现相同的接口
public class JDKProxy implements JDKInterface{
    JDKInterface JDKInterface;//传入被代理的对象

    public JDKProxy(com.sqsf.jdk.JDKInterface JDKInterface) {
        this.JDKInterface = JDKInterface;
    }

    @Override
    public void run() {
        System.out.println("额外执行代码");
        JDKInterface.run();
    }
}
